package com.example.forum.dao;

import com.example.forum.model.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MessageMapper {

    int insert(Message row);

    int insertSelective(Message row);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message row);

    int updateByPrimaryKey(Message row);

    /**
     * date: 2024/09/19 21:00<br/>
     * Description:根据用户id 查询用户未读数
     *
     * @author: jmy <br/>
     */
    int selectUnreadCount(@Param("receiveUserId") Long receiveUserId);

    /**
     * date: 2024/09/20 10:15<br/>
     * Description: 根据 被接受人的用户id 查询被接受人的站内信
     *
     * @author: jmy <br/>
     */
    List<Message> selectByReceiveUserId(@Param("receiveUserId") Long receiveUserId);
}